<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>配置通行证向导</title>
<style rel="stylesheet" type="text/css">
<!--
*{ word-wrap:break-word; outline:none; }
body{ background:#FFF; text-align:center; }
body, td, input, textarea, select, button{ color:#666; font:12px "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; }
body, ul, dl, dd, p, h1, h2, h3, h4, h5, h6, form, fieldset { margin:0; padding:0; }
h1, h2, h3, h4, h5, h6{ font-size:12px; }
a{ color:#2366A8; text-decoration:none; }
	a:hover { text-decoration:underline; }
	a img{ border:none; }
em, cite, th{ font-style:normal; font-weight:normal; }
table{ border-collapse:collapse; }
/* form */
textarea, input{ padding:2px; border:1px solid; border-color:#666 #eee #eee #666; }
input.txt:hover, input.txt:focus, textarea:hover, textarea:focus{ border-color:#09C; background:#F5F9FD; }
.radio{ margin-top:-1px; border:none; vertical-align:middle; }
.checkbox{ height:14px; border:none; vertical-align:middle; }
.btn{ margin:3px 0; padding:2px 5px; *padding:4px 5px 1px; border-color:#ddd #666 #666 #ddd; background:#DDD; color:#000; cursor:pointer; }
.sgbtn{ margin-left:20px; padding:3px 7px; *padding:4px 7px 2px; border:1px solid #B5CFD9; background:#F2F9FD; color:#666; font-size:12px; font-weight:400; }
	.sgbtn:hover{ text-decoration:none; }
.bigarea{ margin-left:5px; width:230px; height:120px; }
.opt{ clear:both; overflow:hidden; }
	.opt th{ padding:5px 0; font-weight:700; text-align:left; }
	.opt td{ padding-bottom:10px; }
	.opt .txt, .opt textarea{ vertical-align:middle; margin-right:10px; width:180px; }
	.opt select{ vertical-align:middle; margin-right:10px; }
	.opt .area{ height:80px; }
	.opt .bigarea { width: 500px; height: 80px; }
	.opt label{ margin-right:20px; }
	.opt p{ float:left; line-height:180%; }
/* title */
h3{ font-size:14px; }
	h3 .btn{ margin-left:10px; vertical-align:middle; }
.mainbox{ margin:10px 0; padding:20px; text-align:left;}
.note{ margin:5px 0; padding:10px; width:580px; border:1px solid #B5CFD9; background:#F5F9FD; }
	.i{ padding-left:22px; line-height:19px; background:url(img/help.gif) no-repeat; }
		.i a{ text-decoration:underline; }
		.i a:hover{ text-decoration:none; }
.fixwidth{ width: 100%; }
	.fixwidthdec{ width:700px; }
-->
</style>
<script type="text/javascript">
function randomAuthKey()
{
    var pwchars = "abcdefhjmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWYXZ";
    var passwordlength = 20;    // do we want that to be dynamic?  no, keep it simple :)
    var passwd = document.getElementById('auth_generated');
    passwd.value = '';

    for ( i = 0; i < passwordlength; i++ )
	{
        passwd.value += pwchars.charAt( Math.floor( Math.random() * pwchars.length ) )
    }
	_Copy();
    return passwd.value;
}
function _Copy()
{
    document.getElementById('authKey').value = document.getElementById('auth_generated').value;
    return true;
}
</script>

</head>
<body background='img/allbg.gif' leftmargin='8' topmargin='8'>
<div class="mainbox">
<h3 style="margin-bottom:10px;">配置通行证向导</h3>
<div class="note fixwidthdec"><p class="i">配置前请备份好{rsms:var.pp_config_file/}配置文件.以防止修改错误导致网站无法运行</p></div>
<form action="api_passport.php" method="post">
	<input name="dopost" type="hidden" value="edit" />
    <table class="opt">
    
    <tr>
        <th colspan="2">通行证类型:</th>
    </tr>
    <tr>
        <td>      
        <input name="pp_setings[ppname]" type="radio" value="phpwind" <?php if($_vars['pp_setings']['ppname'] == 'phpwind') echo 'checked="checked"';?>/> 
        PHPWIND程序(v5.*以上), <input name="pp_setings[ppname]" type="radio" value="discuz" <?php if($_vars['pp_setings']['ppname'] == 'discuz') echo 'checked="checked"';?>/> Discuz6.0
        </td>
        <td></td>
    </tr>
    
    <tr>
        <th colspan="2">通行证方式:</th>
    </tr>
    <tr>
        <td>      
        <select name="pp_setings[pptype]" onChange="if(this.value=='client'){document.getElementById('ppserver').style.display = 'none';document.getElementById('ppclient').style.display = '';}else{document.getElementById('ppclient').style.display = 'none';document.getElementById('ppserver').style.display = '';}">			
			<option value="client" <?php if($_vars['pp_setings']['pptype'] == 'client') echo 'selected="selected"';?>> 客户端(client) </option>
            <option value="server" <?php if($_vars['pp_setings']['pptype'] == 'server') echo 'selected="selected"';?>> 服务端(server) </option>
        </select>
        </td>
        <td></td>
    </tr>
    
    <tr>
        <th colspan="2">通行证密钥:</th>
    </tr>
    <tr>
        <td><input id="authKey" type="text" class="txt" name="pp_setings[ppkey]" value="{rsms:var.pp_setings.ppkey/}" /> <input id="auth_generated" name="auth_generated" type="hidden" value="" /><a href="#" onClick="javascript:randomAuthKey();" class="sgbtn">生成一个KEY</a></td>
        <td></td>
    </tr>


    <tr>
        <td colspan="2">
            <table id="ppserver" class="opt" <?php if($_vars['pp_setings']['pptype'] == 'client') echo 'style="display:none;"';?>>
                <tr>
                    <th colspan="2">服务端地址:</th>
                </tr>
                
                <tr>
                    <td>
                    <input type="text" class="txt" name="pp_setings[ppapi]" value="{rsms:var.pp_setings.ppapi/}" />				
                    </td>
                    <td>填你要整合的网站/论坛地址,他将作为服务端,以http开头,后不要接'/'。</td>
                </tr>
                
                <tr>
                    <th colspan="2">会员注册地址:</th>
                </tr>
                
                <tr>
                    <td>
                    <input type="text" class="txt" name="pp_setings[ppreg]" value="{rsms:var.pp_setings.ppreg/}" />	
                    </td>
                    <td>填写会员注册的地址如:/register.php,注意,没有http开头。</td>		
                </tr>
                
                <tr>
                    <th colspan="2">会员登录地址:</th>
                </tr>                
                <tr>
                    <td>
                    <input type="text" class="txt" name="pp_setings[pplogin]" value="{rsms:var.pp_setings.pplogin/}" />	
                    </td>
                    <td>填写会员登录的地址如:/logging.php?action=login。</td>		
                </tr>
                
                <tr>
                    <th colspan="2">会员退出的地址:</th>
                </tr>

                <tr>
                    <td>
                    <input type="text" class="txt" name="pp_setings[pplogout]" value="{rsms:var.pp_setings.pplogout/}" />	
                    </td>
                    <td>填写会员退出的地址如:/logging.php?action=logout。</td>		
                </tr>                
            </table>
            
            <table id="ppclient" class="opt" <?php if($_vars['pp_setings']['pptype'] == 'server') echo 'style="display:none;"';?>>
                <tr>
                    <th colspan="2">客户端地址:</th>
                </tr>
                
                <tr>
                    <td>
                    <input type="text" class="txt" name="pp_setings[ppapi]" value="{rsms:var.pp_setings.ppapi/}" />				
                    </td>
                    <td>填你要整合的网站/论坛地址,他将作为客户端,以http开头,后不要接'/'。</td>
                </tr>
            </table>
                  
        </td>
    </tr>
    
    <tr>
        <th colspan="2">开启通行证:</th>
    </tr>
    <tr>
        <td>
        <input name="pp_setings[ppopen]" type="radio" value="1" <?php if($_vars['pp_setings']['ppopen']) echo 'checked="checked"';?>/> 
        是, <input name="pp_setings[ppopen]" type="radio" value="0" <?php if(!$_vars['pp_setings']['ppopen']) echo 'checked="checked"';?>/> 否
        </td>
        <td></td>
    </tr>

</table>
<div class="opt"><input type="submit" name="submit" value=" 提 交 " class="btn" tabindex="3" /></div>
    
</form>
</div>
</body>
</html>